package megalopolis.client;

import java.io.IOException;

import megalopolis.common.Config;

/**
 * User: Kirill
 * Date: 19.02.2008
 */
public class Client {

	public void start() throws ClientException {

		// load config
		Config config = getConfig();

		// create controller
		Controller controller = new Controller(config);

		// show main frame and start application
		MainFrame frame = new MainFrame(controller);
		frame.setVisible(true);
	}

	private Config getConfig() throws ClientException {
		try {
			return new Config("client.properties");
		} catch (IOException e) {
			throw new ClientException("Can't load config");
		}
	}
}
